package com.iplant.basic.service.po.bms;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.iplant.base.po.BasePO;
import com.iplant.base.po.enums.DBSchemas;
import com.iplant.base.utils.annotation.condition.DBCondition;
import com.iplant.base.utils.annotation.field.DBField;
import com.iplant.base.utils.annotation.join.DBJoin;
import com.iplant.base.utils.annotation.join.multi.DBJoinMulti;
import com.iplant.base.utils.annotation.po.DBBasePO;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

/**
 * 工位岗位人员设置
 *
 * @author YouWang·Peng
 * 2024-5-16 09:52:19
 */
@DBBasePO(TableName = "bms_position_person", CheckName = {"Code", "LineID,StationID,PositionID"}, CodeAuto = true,
        CodePrefix = "BPP-{yyMMdd}-",
        Schemas =
                DBSchemas.Basic, CodeNum = 4)
public class BMSPositionPerson extends BasePO implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 产线ID
     */
    @DBCondition
    @DBField
    public int LineID = 0;

    /**
     * 产线名称
     */
    @DBCondition(CompareType = DBCondition.DBCompareType.like, ParamName2 = "LineNameEQ")
    @DBJoin(name = "Name", tableName = "fmc_line", tableAsName = "line1", Schemas = DBSchemas.PDM,
            MainTableField = "LineID")
    public String LineName = "";

    /**
     * 产线编码
     */
    @DBCondition(CompareType = DBCondition.DBCompareType.like, ParamName2 = "LineCodeEQ")
    @DBJoin(name = "Code", tableName = "fmc_line", tableAsName = "line1", Schemas = DBSchemas.PDM,
            MainTableField = "LineID")
    public String LineCode = "";

    /**
     * 工位ID
     */
    @DBCondition
    @DBField
    public int StationID = 0;

    /**
     * 工位名称
     */
    @DBCondition(CompareType = DBCondition.DBCompareType.like, ParamName2 = "StationNameEQ")
    @DBJoin(name = "Name", tableName = "fmc_station", tableAsName = "station1", Schemas = DBSchemas.Basic,
            MainTableField = "StationID")
    public String StationName = "";

    /**
     * 工位编码
     */
    @DBCondition(CompareType = DBCondition.DBCompareType.like, ParamName2 = "StationCodeEQ")
    @DBJoin(name = "Code", tableName = "fmc_station", tableAsName = "station1", Schemas = DBSchemas.Basic,
            MainTableField = "StationID")
    public String StationCode = "";

    /**
     * 岗位ID
     */
    @DBCondition
    @DBField
    public int PositionID = 0;

    /**
     * 岗位名称
     */
    @DBCondition(CompareType = DBCondition.DBCompareType.like, ParamName2 = "PositionNameEQ")
    @DBJoin(name = "Name", tableName = "bms_position", tableAsName = "position1", Schemas = DBSchemas.Basic,
            MainTableField = "PositionID")
    public String PositionName = "";

    /**
     * 岗位编码
     */
    @DBCondition(CompareType = DBCondition.DBCompareType.like, ParamName2 = "PositionCodeEQ")
    @DBJoin(name = "Code", tableName = "bms_position", tableAsName = "position1", Schemas = DBSchemas.Basic,
            MainTableField = "PositionID")
    public String PositionCode = "";

    /**
     * 人员ID列表（只支持单选查询）
     */
    @DBCondition(CompareType = DBCondition.DBCompareType.findInSet)
    @DBField
    public List<Integer> PersonIDList = new ArrayList<>();

    /**
     * 人员名称
     */
    @DBJoinMulti(Name = "Name", TableName = "mbs_user", Schemas = DBSchemas.Basic, MainTableField =
            "PersonIDList")
    public String PersonNames = "";

    @JsonProperty("StationID")
    public int getStationID() {
        return StationID;
    }

    public void setStationID(int stationID) {
        StationID = stationID;
    }

    @JsonProperty("StationName")
    public String getStationName() {
        return StationName;
    }

    public void setStationName(String stationName) {
        StationName = stationName;
    }

    @JsonProperty("StationCode")
    public String getStationCode() {
        return StationCode;
    }

    public void setStationCode(String stationCode) {
        StationCode = stationCode;
    }

    @JsonProperty("PositionID")
    public int getPositionID() {
        return PositionID;
    }

    public void setPositionID(int positionID) {
        PositionID = positionID;
    }

    @JsonProperty("PositionName")
    public String getPositionName() {
        return PositionName;
    }

    public void setPositionName(String positionName) {
        PositionName = positionName;
    }

    @JsonProperty("PositionCode")
    public String getPositionCode() {
        return PositionCode;
    }

    public void setPositionCode(String positionCode) {
        PositionCode = positionCode;
    }

    @JsonProperty("PersonIDList")
    public List<Integer> getPersonIDList() {
        return PersonIDList;
    }

    public void setPersonIDList(List<Integer> personIDList) {
        PersonIDList = personIDList;
    }

    @JsonProperty("PersonNames")
    public String getPersonNames() {
        return PersonNames;
    }

    public void setPersonNames(String personNames) {
        PersonNames = personNames;
    }
}
